const express = require('express');
const { verifyToken } = require('../util/jwt');
const validator = require('../middleware/validator/video-validator');
const videoController = require('../controllers/video-controller');
const vodController = require('../controllers/vod-controller');

const router = express.Router();

router
  .get('/likelist/:videoId', videoController.likelist)
  .get('/dislike/:videoId', verifyToken(), videoController.dislikeVideo)
  .get('/like/:videoId', verifyToken(), videoController.likeVideo)
  .delete('/comment/:videoId/:commentId', verifyToken(), videoController.deleteComment)
  .get('/commentlist/:videoId', videoController.commentList)
  .post('/comment/:videoId', verifyToken(), videoController.comment)
  .get('/list', videoController.list)
  .get('/getvod', vodController.getVod)
  .get('/detail/:videoId', verifyToken(false), validator.videoDetail, videoController.videoDetail)
  .get('/videolist', verifyToken(), videoController.getVideoList)
  .post('/createvideo', verifyToken(), validator.createVideo, videoController.createVideo);

module.exports = router;
